home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-in_the_mag-
/
basics
/
blitz
/
cca-source.lha
/
cca-src
/
TXT-SOURCE
/
league.bbh.txt
< prev
next >
Wrap
Text File
|
1998-12-13
|
3KB
|
101 lines
;;;;high score setup
;******************************************************************************************************************************
;******************************************************************************************************************************
Statement _strtoarr{*src, *dest}
b.w = 19
For a.w = 0 To 18
Poke.b (*dest + a),Peek.b(*src + a)
If Peek.b(*dest +a) = 0 ; if null then end string
b = a
a = 19
EndIf
Next
For b = b To 19
Poke.b (*dest + b),0
Next
End Statement
;******************************************************************************************************************************
;Statement _arrtostr{*src}
;
; SHARED the$
; the$ = ""
;
; For b.w = 0 To 18
; If Peek.b(*src + b) = 0
; b = 18
; EndIf
; the$ = the$ + Chr$(Peek.b(*src + b))
; Next
;
;End Statement
Statement _arrtostr{*src, l.w}
SHARED the$
the$ = ""
For b.w = 0 To l
If Peek.b(*src + b) = 0
b = l
EndIf
the$ = the$ + Chr$(Peek.b(*src + b))
Next
End Statement
;******************************************************************************************************************************
#SC_NAMELEN = 20
#SC_TABLEN = 5
#SC_LEVELS = 2
NEWTYPE .score ; Score table entry type
level.l
name.b[#SC_NAMELEN]
End NEWTYPE
;******************************************************************************************************************************
;File constants
#SCR_FILE = 1
#LOF_SCR = (4 + #SC_NAMELEN) * (#SC_LEVELS + 1) * (#SC_TABLEN + 1)
scr_file$ = "sys:s/cca.league"
;******************************************************************************************************************************
;Difficulty = array 1st dim
#EASY = 0
#NORMAL = 1
#TRICKY = 2
;******************************************************************************************************************************
;Standard table holding area
Dim table.score(#SC_LEVELS ,#SC_TABLEN) ; Score table
;******************************************************************************************************************************
;Sort score. Note: last score must contain new score
Function.b sortscr{lev.b}
SHARED table()
For pos.b = #SC_TABLEN To 1 Step -1
If table(lev,pos)\level > table(lev,pos-1)\level
Exchange table(lev,pos)\level,table(lev,pos-1)\level
For b.b = 0 To (#SC_NAMELEN -1)
Exchange table(lev,pos)\name[b] ,table(lev,pos-1)\name[b]
Next b
Else
newscore.b = pos
pos = 0
EndIf
Next pos
Function Return newscore.b
End Function